package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.Collect;
import cn.wolfcode.trip.base.mapper.CollectMapper;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.service.ICollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class CollectServiceImpl implements ICollectService {
    @Autowired
    private CollectMapper mapper;


    @Override
    public void insertCollect(Collect collect) {
        mapper.deleteCollect(collect);
        mapper.insert(collect);
    }

    @Override
    public void deleteDaily(Collect collect) {
        mapper.deleteCollect(collect);
    }

    @Override
    public List<Integer> listDailyIds(long id) {
        List<Integer> list = mapper.selectByUserId(id);
        return  list;
    }

    @Override
    public Map<String, Object> queryUserDaily(long id, long dailyId) {

        return  mapper.queryUserDaily(id,dailyId);
    }

    @Override
    public void deleteDailyId(long dailyId, long userId) {
        mapper.deleteByIdCollect(dailyId,userId);
    }


}
